Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Unknown width



  How regular expression works

Rob Pike wrote 30 lines of codes to realize a simple regular expression matcher in his book The practice of Programming. This piece of code is really cool. Let's take a look at the code.Meaning of different characters.Character Meaning c General character . Match any single character ^ Match start of a string $ Match end of a string * Match zero or many occurrences of a character /*match :Test the regexp in text*/int match(char* regexp,char* text){    if(regexp[0] == '^')&n...

   Regular expression,Implementation,Rob Pike,C     2012-06-25 05:23:41

  Get the 48×48 or 256×256 icon of a file on Windows

Getting the 16×16 and 32×32 icons on Windows is relatively easy and is often as simple as one call to ExtractIconEx. However, getting the extra large (48×48) and jumbo (256×256) icons introduced respectively by XP and Vista is slighly more complex. This is normally done by: Getting the file information, in particular the icon index, for the given file using SHGetFileInfoRetrieving the system image list where all the icons are storedCasting the image list to an IImageList interf...

   File icon,File extension,Association,Large icon,Windows     2012-03-23 09:35:17

  Practice of using spinlock instead of mutex

Spinlock and mutex are two important concepts in multithreading programs. They are used to lock some shared resource to prevent concurrent access which may affect data consistency. But they do have differences, what are the differences? when should we use spinlock instead of mutex? The Theory In theory, when a thread tries to lock a mutex and it does not succeed, because the mutex is already locked, it will go to sleep, immediately allowing another thread to run. It will continue to sleep until...

   Spinlock,Mutex,Concurrency     2014-04-19 21:54:12

  I've got an idea for an app

I’ve been an iPhone developer for over three years now. The first app I built was CookieCombo. We sold enough copies to go bowling twice, but still it was completely worth it. We tweeted about it, and got some awesome gigs out of that. Everybody was in need of iPhone developers, and there was a huge shortage. Good times.As more and more people got to know that I’m an iPhone developer, I got to hear the following phrase more often: “Hey, you know, I got a great idea for an app...

   Idea,App,Induction,Creativity,Innovation     2011-09-08 10:37:09

  What should Microsoft do after Steve Ballmer steps down?

Steve Ballmer decided to retire from Microsoft within 12 months last week. Where should Microsoft head to and what should they do on their products to maintain their influence.Whether you like or hate Ballmer, and regardless of who will replace him as Microsoft new CEO, his voice became a very important part of different Microsoft conferences, Ballmer said : "We need a CEO who will be here longer term for this new direction."Steve Ballmer is criticized for many things. Under his control, Micros...

   Microsoft,CEO,Trend     2013-08-26 07:33:41

  Most Pressed Keys and Programming Syntaxes

I switch between programming languages quite a bit; I often wondered what happens when having to deal with the different syntaxes, does the syntax allow you to be more expressive or faster at coding in one language or another. I dont really know about that; but what I do know what keys are pressed when writing with different programming languages. This might be something interesting for people who are deciding to select a programming language might look into, here is a post on the...

   Keyboard,Programming language,Hottest ke     2011-09-23 13:10:10

  Substitute of Right Click Computer to Open Manage

I believe some of us may encounter some strange problems when we expect something normal to happen when we operate on our computer. On Windows 7, we may sometimes want to manage our service or applications by opening service manager.But somehow we may find that we cannot open it by clicking on Start->Right click on Computer->Manage.It may prompt some error message to tell us we cannot open the service manager. Then what to do? Here is a way to open it,goto Start->Run,then type "com...

   Computer Management,Win 7,compmgmt.msc,S     2011-03-31 01:09:44

  Share on Twitter link

Ever wanted to give your readers, or your client’s readers a chance to share the post quickly on Twitter?The code is straight forward:<a href=”http://twitter.com/home?status=Currently reading http://www.test.com/post-url” title=”Click to share this post on Twitter”>Share on Twitter</a>If you’re using WordPress and want to automate this, simply use the following to insert the link to the current post in the loop into your link:<a href=”ht...

   Twitter,Share button,Customize,Custom     2011-08-24 10:55:51

  Announcing the Windows 8 Editions

Today I would like to share information with you on the editions that will be available for "Windows 8" when it is released to market. We have talked about Windows 8 as Windows reimagined, from the chipset to the user experience. This also applies to the editions available – we have worked to make it easier for customers to know what edition will work best for them when they purchase a new Windows 8 PC or upgrade their existing PC. Windows 8 has the flexibility you need - whether...

   Windows 8,Windows RT,New version     2012-04-17 06:19:16

  A return to good code

Stop doing this:public boolean foo() { if (true) {   return true;   }  else {   return false;   }}It always amazes me when I dig into an open source project, and I see code written by supposed experts, and reviewed by seasoned professionals, and nobody slaps the wrists of the developer who shoves return statements right in the middle of a method.Tell me, how hard is it to do this:public boolean foo() {   boolean flag = true;  ...

   Java,Code,Method,Return,Condition     2011-03-23 01:24:47